// tsx 中接收及使用props
interface Props {
  userName?: string;
  userAge?: number;
}

const handleClick = (props: Props) => {
  console.log(props);
};

const tsxDom = (props: Props) => {
  return (
    <>
      <div>{props.userName}</div>
      <div>{props.userAge}</div>
      <button onClick={() => handleClick(props)}>点击</button>
    </>
  );
};

export default tsxDom;
